package DAO;

import java.util.List;

import model.core.code.ClassData;
import model.core.code.CodeSeg;
import model.core.code.EntranceType;
import model.core.code.IEntrance;
import model.core.code.MethodData;
import model.core.code.MethodToken;
import model.core.code.Usage;

public interface ICodeDAO {
	
	public ClassData declareClass(String path);
	public boolean saveDeclaredClass(ClassData data);
	
	//following two declare methods all have side effects, will change the id of params
	public boolean declareCodeSeg(CodeSeg codeSeg);
	public boolean declareMethodToken(MethodToken token);
	public boolean declareMethod(MethodData mthdData);

	public void addEntrance(MethodData method, IEntrance entrance, Usage usg);
	
	public void addCall(MethodData method, MethodToken called);
	
	public void connectEntrance(IEntrance var, IEntrance type);

	public List<IEntrance> getRelatedEntrance(IEntrance ent);
	
	public ClassData getClassData(int id);
	public ClassData getClassData(String path);

	public CodeSeg getCodeSegment(int id);
	public MethodData getMethodData(int methodID);
	public MethodToken getMethodToken(int tokenID);
	public MethodToken getMethodToken(String token);

	public IEntrance declareEntrance(IEntrance ent);

	public List<IEntrance> getEntranceOfMethod(int methodID);
	public List<MethodData> getRelatedMethod(int entID);
	
	public IEntrance getEntrance(String token, EntranceType type);
	public IEntrance getEntrance(int entrID);
}
